package com.xiaomaoguai.observer.example.pull;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ConcreteSubject extends Subject {

    private static final Logger LOGGER = LoggerFactory.getLogger(ConcreteSubject.class);

    private String state;

    public String getState() {
        return state;
    }

    public void change(String newState) {
        state = newState;
        LOGGER.info("pull", "主题状态为：" + state);
        //状态发生改变，通知各个观察者
        this.nodifyObservers();
    }
}
